[6.19.z] Change 'iop_advisor_engine' settings to 'iop'. - #20899
Conversation
(cherry picked from commit 429c0cc)
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRename the IoP configuration namespace from rh_cloud.iop_advisor_engine to rh_cloud.iop across podman helpers, IoP setup, configuration validation, fixtures, and tests so they all consume the new settings structure. Sequence diagram for IoP configuration using rh_cloud.iop settingssequenceDiagram
actor Tester
participant IoPSetup
participant Host
participant Settings
participant RhCloudSettings
participant IopSettings
participant PodmanRegistry
Tester->>IoPSetup: configure_iop()
IoPSetup->>Host: ensure_podman_installed()
Host-->>IoPSetup: podman available
IoPSetup->>Settings: rh_cloud
Settings-->>IoPSetup: RhCloudSettings
IoPSetup->>RhCloudSettings: iop
RhCloudSettings-->>IoPSetup: IopSettings
IoPSetup->>Host: podman_login(IopSettings.username, IopSettings.token, IopSettings.registry)
Host->>PodmanRegistry: podman login using authfile
PodmanRegistry-->>Host: login success
IoPSetup->>Host: podman_login(IopSettings.stage_username, IopSettings.stage_token, IopSettings.stage_registry)
Host->>PodmanRegistry: podman login stage registry
PodmanRegistry-->>Host: login success
IoPSetup-->>Tester: IoP configured with rh_cloud.iop
Sequence diagram for IoP deploy args using rh_cloud.iop.image_pathssequenceDiagram
actor Tester
participant Fixture
participant Settings
participant RhCloudSettings
participant IopSettings
Tester->>Fixture: get_iop_deploy_args()
Fixture->>Settings: rh_cloud
Settings-->>Fixture: RhCloudSettings
Fixture->>RhCloudSettings: iop
RhCloudSettings-->>Fixture: IopSettings
Fixture->>IopSettings: image_paths
IopSettings-->>Fixture: {service: path}
Fixture->>Fixture: build iop_service_image args from image_paths
Fixture->>Settings: server.deploy_arguments.to_dict()
Settings-->>Fixture: deploy_args
Fixture->>Tester: merged deploy_args with IoP image args
Class diagram for IoP helpers and settings using rh_cloud.iopclassDiagram
class Host {
+ensure_podman_installed()
+podman_login(username, password, registry)
+is_podman_logged_in(registry)
+podman_logout(registry)
}
class IoPSetup {
+get_iop_image_paths() dict
+configure_iop()
}
class Settings {
+rh_cloud RhCloudSettings
+server ServerSettings
}
class RhCloudSettings {
+token str
+iop IopSettings
}
class IopSettings {
+username str
+token str
+registry str
+stage_username str
+stage_token str
+stage_registry str
+image_paths dict
}
class ServerSettings {
+deploy_arguments DeployArguments
}
class DeployArguments {
+to_dict() dict
}
class RhCloudValidators {
+rh_cloud_token_required
+iop_image_paths_default_dict
}
Host ..> Settings : uses
IoPSetup ..> Host : configures
IoPSetup ..> Settings : reads
RhCloudSettings o-- IopSettings
Settings o-- RhCloudSettings
Settings o-- ServerSettings
ServerSettings o-- DeployArguments
RhCloudValidators ..> RhCloudSettings : validates iop.image_paths
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Since this is a namespace rename of a config key, consider temporarily supporting both
rh_cloud.iopandrh_cloud.iop_advisor_engine(with a clear precedence) to ease rollout and avoid breaking existing configs that haven’t been migrated yet. - There are several repeated
iop_settings = settings.rh_cloud.ioppatterns across helpers and fixtures; you might want to introduce a small helper/accessor for IoP settings to centralize this and make future renames or structural changes less invasive.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Since this is a namespace rename of a config key, consider temporarily supporting both `rh_cloud.iop` and `rh_cloud.iop_advisor_engine` (with a clear precedence) to ease rollout and avoid breaking existing configs that haven’t been migrated yet.
- There are several repeated `iop_settings = settings.rh_cloud.iop` patterns across helpers and fixtures; you might want to introduce a small helper/accessor for IoP settings to centralize this and make future renames or structural changes less invasive.
## Individual Comments
### Comment 1
<location path="robottelo/config/validators.py" line_range="341" />
<code_context>
- Validator(
- 'rh_cloud.iop_advisor_engine.image_paths', default={}, apply_default_on_none=True
- ),
+ Validator('rh_cloud.iop.image_paths', default={}, apply_default_on_none=True),
],
repos=[
</code_context>
<issue_to_address>
**issue (bug_risk):** Consider backward compatibility with existing `rh_cloud.iop_advisor_engine.image_paths` configs.
By switching validation to `rh_cloud.iop.image_paths`, deployments that still set `rh_cloud.iop_advisor_engine.image_paths` will now get the default `{}` and leave `iop.image_paths` unset, potentially changing behavior without any explicit signal. To avoid silent misconfigurations, consider either reading from both keys (preferring `iop.image_paths`) or failing fast when the old key is set but the new one is not.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| Validator( | ||
| 'rh_cloud.iop_advisor_engine.image_paths', default={}, apply_default_on_none=True | ||
| ), | ||
| Validator('rh_cloud.iop.image_paths', default={}, apply_default_on_none=True), |
There was a problem hiding this comment.
issue (bug_risk): Consider backward compatibility with existing rh_cloud.iop_advisor_engine.image_paths configs.
By switching validation to rh_cloud.iop.image_paths, deployments that still set rh_cloud.iop_advisor_engine.image_paths will now get the default {} and leave iop.image_paths unset, potentially changing behavior without any explicit signal. To avoid silent misconfigurations, consider either reading from both keys (preferring iop.image_paths) or failing fast when the old key is set but the new one is not.
Cherrypick of PR: #20861
Problem Statement
iop_advisor_engineis not an accurate label anymore for IoP settings.Solution
Change 'iop_advisor_engine' to 'iop'.
6.18.z and 6.17.z PRs will be done manually.
Related Issues
Summary by Sourcery
Rename IoP configuration usage from the deprecated
iop_advisor_enginenamespace to the newiopnamespace across code, configuration validation, and tests.Enhancements:
settings.rh_cloud.iop.rh_cloud.iop.image_pathskey.Summary by Sourcery
Rename the IoP configuration namespace from
rh_cloud.iop_advisor_enginetorh_cloud.iopacross runtime code, configuration validation, and tests.Enhancements:
settings.rh_cloud.iop.rh_cloud.iop.image_pathsinstead of the deprecatediop_advisor_enginekey.rh_cloud.iopsettings namespace for IoP image paths and authentication.Summary by Sourcery
Rename the IoP configuration namespace from the deprecated
iop_advisor_enginekey toiopacross runtime code, configuration validation, and tests.Enhancements:
settings.rh_cloud.iop.rh_cloud.iop.image_pathsinstead of the oldiop_advisor_engine.image_pathskey.rh_cloud.iopsettings namespace for IoP-related operations.